local m = require('utils.proxy')
local t = require('utils.table')

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
    vim.fn.system({
        "git",
        "clone",
        "--filter=blob:none",
        m.get_proxy("folke/lazy.nvim.git"),
        "--branch=v10.4.1",
        lazypath,
    })
end
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)

local specs =  {
    {import="plugins"},
    {import="plugins/telescope"},
    {import="plugins/statusline"},
    {import="plugins/treesitter"},
    {import="plugins/project"},
    {import="plugins/avante"},
    {import="plugins/cmp"},
    -- lang
    {import="plugins/terminal"},
    {import="plugins/lint"},
}

require("lazy").setup({
    spec = specs,
    git = {
        url_format = m.get_proxy("%s")
    },
    rocks = {
        enabled = false  -- Disable luarocks temporarily
    },
    performance = {
        rtp = {
            -- disable some rtp plugins
            disabled_plugins = {
                "2html_plugin",
                "getscript",
                "getscriptPlugin",
                "gzip",
                "logipat",
                "netrw",
                "netrwPlugin",
                "netrwSettings",
                "netrwFileHandlers",
                "matchit",
                "tar",
                "tarPlugin",
                "rrhelper",
                "spellfile_plugin",
                "vimball",
                "vimballPlugin",
                "zip",
                "zipPlugin",
                "tutor",
                "rplugin",
                "synmenu",
                "optwin",
                "compiler",
                "bugreport",
                "ftplugin",
            },
        },
    },
})
-- EOF
